package kontroler;

import misc.Role;
import basic.Club;
import basic.Country;
import basic.League;
import basic.Match;
import basic.Player;
import basic.Round;
import basic.World;

public class Kontroler {

	private Player player = null;
	private Club club = null;
	private League league = null;
	private Country country = null;
	private World world = null;
	private Match match = null;
	private Round round = null;
	
	public Kontroler() {
		super();
		this.player = new Player();
		this.club = new Club();
		this.league = new League();
		this.country = new Country();
		this.world = new World();
		this.match = new Match();
		this.round = new Round();
	}
	
	public void addPlayer(String firstName, String lastName,String dateOfBirth, Role role, Club club, Country country){
		club.addPlayer(club.createPlayer(firstName, lastName, dateOfBirth, role, club, country));
	}
	public void removePlayer(Player player){
		player.getClub().removePlayer(player);
	}
	
	
	public void addClub(String name,League leagueObj){
		leagueObj.addClub(league.createClub(name, leagueObj));
	}
	public void removeClub(String name,League leagueObj){
		leagueObj.removeClub(name, leagueObj);
	}
	public Club getClub(String name, League leagueObj){
		return leagueObj.getClub(name);
	}
	public Object[] getClubLeagueView(Club clubObj){
		return clubObj.getClubLeagueView();
	}
	
	public void addCountry(String name){
		world.addCountry(name);
	}
	public void removeCountry(String name){
		world.removeCountry(name);
	}
	public Country[] getCountries(){
		return world.getCountries();
	}
	public Country getCountry(String name){
		return world.getCountry(name);
	}
	
	
	public void addLeague(String name, Country countryObj){
		countryObj.addLeague(country.createLeague(name, countryObj));
	}
	public void removeLeague(String name, Country countryObj){
		countryObj.removeLeague(name, countryObj);
	}
	public League[] getLeagues(Country countryObj){
		return countryObj.getLeaguesArray();
	}
	public League getLeague(String name,Country countryObj){
		return countryObj.getLeague(name);
	}
	
	
	
	
	public void addRound(int round){
		league.addRound(round);
	}
	public void removeRound(int round){
		league.removeRound(round);
	}
	
	
	public void addMatch(Club home,Club away,String result,String time){
		round.addMatchToRound(new Match(home, away, result, time));
	}
	public void removeMatch(Match match){
		round.removeMatchFromRound(match);
	}
	
	
	
}
